import Vue from "vue";
import VueRouter from "vue-router";
import Home from "../views/Home.vue";
import About from "../views/About.vue";
import PageCharge from "../views/PageCharge.vue";
import GoodCharge from "../views/GoodCharge.vue";
import GoodsChargeCreate from "../views/goodsChargeCreate.vue";
import orderCharge from "../views/orderCharge.vue";
import orderInfo from "../views/orderInfo.vue";
import rulesEdit from "../views/rulesEdit.vue";
import jifenData from "@/views/jifenData.vue";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "Home",
    component: Home,
    redirect: "/about",
    children: [
      {
        path: "/about",
        name: "about",
        component: About,
        meta: {
          title: "概况",
          icon: "el-icon-s-home",
          noCache: true,
          affix: true
        }
      },
      {
        path: "/jifenData",
        name: "jifenData",
        component: jifenData,
        meta: {
          title: "积分数据",
          icon: "el-icon-s-home",
          noCache: true,
          affix: true
        }
      },

      {
        path: "/rulesEdit",
        name: "rulesEdit",
        component: rulesEdit,
        meta: {
          title: "规则设置",
          icon: "el-icon-s-home",
          noCache: true,
          affix: true
        }
      },
      {
        path: "/pageCharge",
        name: "pageCharge",
        component: PageCharge,
        meta: {
          title: "分类管理",
          icon: "el-icon-s-home",
          noCache: true,
          affix: true
        }
      },
      {
        path: "/goodsCharge",
        name: "goodsCharge",
        component: GoodCharge,
        meta: {
          title: "商品管理",
          icon: "el-icon-s-home",
          noCache: true,
          affix: true
        }
      },
      {
        path: "/goodsChargeCreate",
        name: "goodsChargeCreate",
        component: GoodsChargeCreate,
        meta: {
          title: "发布商品",
          icon: "el-icon-s-home",
          noCache: true,
          affix: true
        }
      },
      {
        path: "/orderCharge",
        name: "orderCharge",
        component: orderCharge,
        meta: {
          title: "订单管理",
          icon: "el-icon-s-home",
          noCache: true,
          affix: true
        }
      },
      {
        path: "/orderInfo",
        name: "orderInfo",
        component: orderInfo,
        meta: {
          title: "订单详情",
          icon: "el-icon-s-home",
          noCache: true,
          affix: true
        }
      }
    ]
  }
];

const router = new VueRouter({
  routes
});

export default router;
